// https://leetcode.cn/problems/maximum-number-of-balloons/
// Created by ade on 2022/11/1.
//

class Solution {
public:
    int maxNumberOfBalloons(string text) {
        // balloon
        unordered_map<int, int> m = {};
        string balon = "balon";
        for (auto &i:balon)m[i - 'a'] = 0;
        for (auto &i:text)
            m[i - 'a']++;
        int count = 10000;
        for (auto &i:balon) {
            if (i == 'l' || i == 'o') {
                count = min(count, m[i - 'a'] / 2);
            } else {
                count = min(count, m[i - 'a']);
            }
        }
        return count;


    }
};